export default {
  mounted () {
    console.log('mixin选项')
    this._initScrollEvent()
  },
  destroyed () {
    window.removeEventListener('scroll', this._scrollEvent)
  },
  methods: {
    _initScrollEvent () {
      window.addEventListener('scroll', this._scrollEvent)
    },
    _scrollEvent (e) {
      const scrollY = window.scrollY
      const viewHeight = window.innerHeight
      const bodyHeight = document.body.clientHeight
      if (scrollY + viewHeight === bodyHeight) {
        this.scrollBottom()
      }
    }
  }
}
